package com.situ.boot;


import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.DispatcherServlet;

// 声明该类是SprintBoot的引导类
@SpringBootApplication
// @MapperScan注解，扫描MyBatis Mapper接口类所在包
@MapperScan("com.situ.boot.mapper")
public class MyApplication {

    // main是程序的入口
    public static void main(String[] args) {
        // run方法表示运行SprintBoot的引导类，run方法的参数是SprintBoot引导类的字节码对象
        SpringApplication.run(MyApplication.class);
    }

    /**
     * 设置匹配.action后缀的请求
     * @param dispatcherServlet
     * @return
     */
   /*@Bean
    public ServletRegistrationBean servletRegistrationBean(DispatcherServlet dispatcherServlet) {
        ServletRegistrationBean bean = new ServletRegistrationBean(dispatcherServlet);
        bean.addUrlMappings("*.action");
        bean.addUrlMappings("*.shtml");
        return bean;
    }*/
}
